@extends('Admin.Index.index')
@section('title')
    商品属性值列表
@endsection
@section('content')
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="r">共有数据：<strong>{{$count}}</strong> 条</span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg table-sort">
        <thead>
        <tr class="text-c">
            <th>属性ID</th>
            <th>属性值</th>
            <th>属性-价格</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($data as $v)
            <tr class="text-c">
                <td>{{$v->p_id}}</td>
                <td>{{$v->p_value}}</td>
                <td>{{$v->price}}</td>
                <td>
                    <a title="修改属性值"   href="{{action('Admin\PropertyController@property_value_update',['p_id'=>$v->p_id,'p_value'=>$v->p_value])}}" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                    {{--<a title="删除属性" onclick="class_del(this,'{{$v->p_id}}','{{$v->p_value}}')" class="Hui-iconfont">&#xe609;</a>--}}
                    <a title="删除属性" href="{{action('Admin\PropertyController@property_value_delete',['p_id'=>$v->p_id,'p_value'=>$v->p_value])}}" class="Hui-iconfont">&#xe609;</a>
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
    <div id="pageNav" class="pageNav"></div>
</div>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
//    function class_del(obj,p_id,p_value) {
//        layer.confirm('确认要删除吗？', function (index) {
//            $.ajax({
//                type: 'POST',
//                url: '/property_value_delete/'+['p_id','p_value'],
//                dataType: 'json',
//                success: function (e) {
//                    console.log(e);
//                    if (e.status) {
//                        $(obj).parents("tr").remove();
//                        layer.msg('已删除!', {icon: 1, time: 1000});
//                    }else {
//                        layer.msg(e.info);
//                    }
//                }
//            });
//        });
//    }
</script>
@endsection
